/**
 * 
 */
package com.zxc.jsonp;

import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import cn.hutool.core.collection.CollectionUtil;

/**
 * @author admin
 *
 */
public class JsonpDemo {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		
		String one = "1234567890QWERTYUIOPASDFGHJKLZXCVBNM";
		String two = "1234567890QWERTYUIOPASDFGHJKLZXCVBNM";
		
		Document doc = Jsoup.connect("https://www.seabay.cn/cn/airlines/AA.html").get();
		System.out.println(doc.title());
		Element divmessage = doc.getElementById("divmessage");
		
		Elements tables = divmessage.getElementsByTag("table");
		Elements tbodys = tables.first().getElementsByTag("tbody");
		
		Element tr = tbodys.first().child(1);
		if(CollectionUtil.isNotEmpty(tr.child(0).getElementsByTag("strong"))) {
			System.out.println("Prefix:"+tr.child(0).getElementsByTag("strong").first().child(0).html());
			System.out.println("IATA Code:"+tr.child(1).getElementsByTag("strong").first().child(0).html());
			System.out.println("中文名:"+tr.child(2).getElementsByTag("strong").first().child(0).child(0).html());
		}
		
	}

}
